import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
          path:'/',
          redirect:'/dashboard',
          meta:{requireAuth:true},
        },
        {
            path: '/',
            component: resolve => require(['../views/common/Home.vue'], resolve),
            meta:{requireAuth:true,title:'自述文件'},
            children:[
                  {
                    path: '/dashboard',
                    component: resolve => require(['../views/page/dashboard.vue'], resolve),
                    meta:{requireAuth:true,title:'首页'},
                    
                },
                {
                    path: '/generator',
                    component: resolve => require(['../views/page/gen/index.vue'], resolve),
                    meta:{requireAuth:true,title:'代码生成'},
                },
                {
                    path: '/404',
                    component: resolve => require(['../views/page/404.vue'], resolve),
                    meta:{requireAuth:true,title:'404'},
                },
                {
                    path: '/403',
                    component: resolve => require(['../views/page/403.vue'], resolve),
                    meta:{requireAuth:true,title:'自403述文件'},
                }
            ]
        },
        {
          path: '/login',
          component: resolve => require(['../views/page/login/Login.vue'], resolve)
         },
        {
            path: '*',
            redirect: '/dashboard'
        }
    ]
})
